package clientes;

import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import org.joda.time.DateTime;
import org.junit.Before;
import org.junit.Test;

/**
 * Clase test de Ticket.
 * @author Stefania
 *
 */

public class TicketTest {
	
	Ticket ticket;
	DateTime fecha;
	
	@Before
	public void setUp() throws Exception {
		fecha=new DateTime();
		this.ticket= new Ticket(250f, fecha,mock(ListaDeCompras.class));
	}

	@Test
	public void testGetPrecio() {
		assertEquals(250f,ticket.getPrecio(),0.002f);
	}
	
	@Test
	public void testGetFecha() {
		assertEquals(fecha,ticket.getFecha());
	}
	
	@Test
	public void testSetListaYGetLista(){
		ListaDeCompras listaMock= mock(ListaDeCompras.class);
		ticket.setLista(listaMock);
		assertSame(listaMock,ticket.getLista());
	}
	
	


}
